using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FetCo.Data;
using Friso.Entities;
using Friso.Business;
using FetCo.Framework;
using System.IO;

public partial class Kich_Hoat_Tai_Khoan : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["code"]))
            LoadActivate(Request.QueryString["code"]);
    }
    #region Activate Code
    protected void LoadActivate(string ActivateCode)
    {
        Criteria cri = new Criteria();
        cri.add(MemberColumns.ActivateCode, ActivateCode, Condition.EQUAL, Condition.AND);
        MemberCollection _MemberCollection = MemberService.GetMemberListByParam("[" + Friso.Entities.Member._Table + "].[" + MemberColumns.ActivateCode + "]", OrderDirection.ASC, cri.Criter);

        if (_MemberCollection.Count > 0)
        {
            divErr.Visible = false;
            divSussecc.Visible = true;
            #region Update Member
            Member _Member = _MemberCollection[0];
            Session["MemberID"] = _Member.MemberID;
            _Member.ActivateCode = "";
            MemberService.UpdateMember(_Member);
            #endregion
        }
        else
        {
            divErr.Visible = true;
            divSussecc.Visible = false;
        }


    }
    #endregion
}
